Skip to content

feat(generator): generate the SDK from the OpenAPI spec - #12

Merged
nmorgan-cb merged 4 commits into
mainfrom
feat/generator-1-bindings
Nov 25, 2026
Merged

nmorgan-cb merged 4 commits into
mainfrom
feat/generator-1-bindings

Conversation

@nmorgan-cb

@nmorgan-cb nmorgan-cb commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds automated generation of the SDK from the OpenAPI spec. No generated SDK output is committed.

  • make generate builds models, request/response DTOs, services and PrimeServiceFactory from apiSpec/prime-public-spec.yaml.
  • Output keeps the existing SDK layout, so regenerating from the committed spec leaves current classes and enums unchanged.
  • Renamed operations get a canonical name plus a @Deprecated alias of the old name, set in operations-overrides.json, so existing callers still compile.
  • Tests lock every operation's service, method, aliases and success status codes, and the method names shared with the Go, Python and TypeScript SDKs.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Dependency update
  • Refactor / cleanup
  • Other (describe below)

Checklist

  • Tests included / updated
  • Changelog updated
  • Version bump if needed

Parse the committed spec into a stable, operation-ID sorted inventory and
derive one Java binding per operation (service folder, service name,
method, request/pagination shape). Config-driven overrides keep the vended
SDK names and types; the validator rejects missing path parameters,
duplicate methods, and one service name bound to two folders.

- SpecParser fails on operations without an operationId.
- SpecFetcher replaces the committed spec only after a 2xx response that
  parses with operations.
- JavaTypeResolver maps schemas to vended model/enum types, keeps DTO
  booleans boxed, and rejects ambiguous inline enums.
- operation-inventory.json locks the vended service and method of all 111
  current operations; new spec operations are allowed.
Post-process raw OpenAPI models so *ErrorCode/*Subcode enums land in
com.coinbase.prime.model.errors and every other enum keeps its vended
package. Model output is tracked in a manifest, so stale files are removed
only when the previous generation owned them, and enum directory read
errors fail generation instead of emitting partial imports.
@nmorgan-cb
nmorgan-cb requested a review from a team as a code owner November 20, 2026 19:32
@cb-heimdall

cb-heimdall commented Nov 20, 2026 •

Copy link
Copy Markdown

✅ Heimdall Review Status

Requirement Status More Info
Reviews ✅ 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
1 if authored by an app that is not allowlisted and lacks verified human attribution 0
Sum 1

rcbgr
rcbgr previously approved these changes Nov 24, 2026
@nmorgan-cb
nmorgan-cb force-pushed the feat/generator-1-bindings branch from 614c52d to 67003db Compare November 24, 2026 19:26
@nmorgan-cb nmorgan-cb changed the title feat(generator): parse the OpenAPI spec into SDK operation bindings feat(generator): generate the SDK from the OpenAPI spec Nov 24, 2026

@nmorgan-cb nmorgan-cb left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a couple of comments addressed

Comment thread .github/workflows/test.yml Resolved
rcbgr
rcbgr previously approved these changes Nov 24, 2026
… vended layout

- Emit request/response DTOs, service interfaces/impls, and PrimeServiceFactory
- Add make generate and make check-generated targets and CoinbasePrimeClient.withBaseUrl
- Add deprecated subclass aliases from operations-overrides.json and align 14 method names with Go, Python, and TypeScript SDKs
- Preserve vended class layout, Javadoc, and member ordering via SourceLayout
- Lock operation inventory and cross-SDK naming parity in generator tests
… order examples

- Add optional limit_price, stop_price, and time_in_force CLI arguments to CreateOrder and CreateOrderPreview
- Default time_in_force to GOOD_UNTIL_CANCELLED when limit_price is supplied for LIMIT or STOP_LIMIT orders
@nmorgan-cb
nmorgan-cb merged commit d0bcd90 into main Nov 25, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants